<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01_BOM操作</title>
</head>
<body>
<button onclick="alert('请先登录')">弹出警告框</button>
<button onclick="confirm('确认删除吗')">弹出确认框</button>

<script>
    //Window是浏览器内置的全局对象，无需创建或导包，直接使用其属性与方法
    //parseInt():将参数以舍弃小数部分的方式转换成整数，如果不是数字类型则得到NaN

    console.log(parseInt(6.6));
    console.log(parseInt(6.1));
    console.log(parseInt(6));
    console.log(parseInt('6.99'));
    console.log(parseInt('hhh'));   //NaN

    // parseFloat():将参数转换成小数,如果得不到数字类型结果,会得到NaN
    console.log(parseFloat(6.6));
    console.log(parseFloat(6.1));
    console.log(parseFloat(6));
    console.log(parseFloat('6.99'));
    console.log(parseFloat('hhh'));//NaN

    //isNaN():判断参数是否为NaN,如果是NaN返回true,否则返回false
    console.log(isNaN('hhh'));//true
    console.log(isNaN(6.6));//false
    console.log(isNaN(6));//false
    console.log(isNaN('6'));//false

</script>
</body>
</html>